<?php

function getagent($uid,$fs)
{
    $agent=new \app\common\model\Agent();
    $map['id'] = $uid;
    $agent =$agent->where($map)->find();

    switch ($fs) {
        case "name":
            return $agent['name'];
            break;
        case "zh":
            $Loginusers=new \app\common\model\LoginUsers();
            $zh = $Loginusers->where(array('id' => $agent['uid']))->value('username');
            return $zh;
            break;

    }
    //return $agent;
}

//function authcheck($rule, $uid, $type = 1, $mode = 'url', $relation = 'or')
//{
//    if (in_array(session("uid"), C("ADMINISTRATOR"))) {
//        return true;
//    }
//    $auth = new \Think\Auth();
//    return $auth->check($rule, $uid, $type, $mode, $relation) ? true : false;
//
//}